package com.freesky.biz.activity.controller;

import com.freesky.biz.activity.domain.TRechargeDetail;
import com.freesky.biz.activity.service.IRechargeDetailService;
import com.freesky.biz.icbc.domain.TMobileRecharge;
import com.freesky.common.annotation.Log;
import com.freesky.common.core.controller.BaseController;
import com.freesky.common.core.domain.AjaxResult;
import com.freesky.common.core.page.TableDataInfo;
import com.freesky.common.enums.BusinessType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/activity/recharge/detail")
public class RechargeDetailController extends BaseController {
    @Autowired
    private IRechargeDetailService rechargeDetailService;

    /**
     * 话费充值列表
     */
    @PreAuthorize("@ss.hasPermi('recharge:detail:list')")
    @GetMapping("/list")
    public TableDataInfo list(TRechargeDetail entity) {
        startPage();
        List<TRechargeDetail> list = rechargeDetailService.findList(entity);
        return getDataTable(list);
    }

    @Log(title = "话费充值", businessType = BusinessType.EXPORT)
    @PreAuthorize("@ss.hasPermi('recharge:detail:export')")
    @GetMapping("/export")
    public AjaxResult export(TRechargeDetail entity,
                             TRechargeDetail response) {
        return rechargeDetailService.exportFile(entity);
    }

}
